<?php
// +----------------------------------------------------------------------
// | VueAdmin框架[基于ThinkPHP5开发]
// +----------------------------------------------------------------------
// | Copyright (c) 2016-2018 http://www.vueadmin.org
// +----------------------------------------------------------------------
// | VueAdmin承诺基础框架永久免费开源，您可用于学习和商用，但必须保留软件版权信息。
// +----------------------------------------------------------------------
// | Author: sept <917088650@qq.com>，开发者QQ群：50304283
// +----------------------------------------------------------------------

namespace app\lib\Auth;


/**
 * 存储当前登录用户信息类
 * Class Auth
 * @package app\lib\Auth
 */
class Auth
{
    //TODO 考虑跟中间件的Auth类进行整合为一个类
    private static $Auth;

    public static function setAuth($auth) {
        self::$Auth = $auth;
    }

    public static function getAuth(){
        return self::$Auth;
    }

    public static function id () {
        return self::$Auth->id;
    }

    public static function user() {
        return self::$Auth->user;
    }

    public static function username() {
        return self::$Auth->user->username;
    }

    public static function nickname() {
        return self::$Auth->user->nickname;
    }

    public static function role_id() {
        return self::$Auth->user->role_id;
    }

}
